Integrand size = 30, antiderivative size = 66 \[ \int (a+b \tan (c+d x)) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=-((b B+a C) x)-\frac {(a B-b C) \log (\cos (c+d x))}{d}+\frac {b B \tan (c+d x)}{d}+\frac {C (a+b \tan (c+d x))^2}{2 b d} \]
[Out]
Time = 0.06 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3711, 3606, 3556} \[ \int (a+b \tan (c+d x)) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=-\frac {(a B-b C) \log (\cos (c+d x))}{d}-x (a C+b B)+\frac {C (a+b \tan (c+d x))^2}{2 b d}+\frac {b B \tan (c+d x)}{d} \]
[In]
[Out]
Rule 3556
Rule 3606
Rule 3711
Rubi steps \begin{align*} \text {integral}& = \frac {C (a+b \tan (c+d x))^2}{2 b d}+\int (a+b \tan (c+d x)) (-C+B \tan (c+d x)) \, dx \\ & = -((b B+a C) x)+\frac {b B \tan (c+d x)}{d}+\frac {C (a+b \tan (c+d x))^2}{2 b d}+(a B-b C) \int \tan (c+d x) \, dx \\ & = -((b B+a C) x)-\frac {(a B-b C) \log (\cos (c+d x))}{d}+\frac {b B \tan (c+d x)}{d}+\frac {C (a+b \tan (c+d x))^2}{2 b d} \\ \end{align*}
Time = 0.33 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.02 \[ \int (a+b \tan (c+d x)) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {-2 (b B+a C) \arctan (\tan (c+d x))+2 (-a B+b C) \log (\cos (c+d x))+2 (b B+a C) \tan (c+d x)+b C \tan ^2(c+d x)}{2 d} \]
[In]
[Out]
Time = 0.05 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.05
method | result | size |
norman | \(\left (-B b -C a \right ) x +\frac {\left (B b +C a \right ) \tan \left (d x +c \right )}{d}+\frac {C b \tan \left (d x +c \right )^{2}}{2 d}+\frac {\left (B a -C b \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}\) | \(69\) |
derivativedivides | \(\frac {\frac {C \tan \left (d x +c \right )^{2} b}{2}+B \tan \left (d x +c \right ) b +C \tan \left (d x +c \right ) a +\frac {\left (B a -C b \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (-B b -C a \right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(74\) |
default | \(\frac {\frac {C \tan \left (d x +c \right )^{2} b}{2}+B \tan \left (d x +c \right ) b +C \tan \left (d x +c \right ) a +\frac {\left (B a -C b \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (-B b -C a \right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(74\) |
parts | \(\frac {\left (B b +C a \right ) \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {B a \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}+\frac {C b \left (\frac {\tan \left (d x +c \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}\right )}{d}\) | \(77\) |
parallelrisch | \(\frac {-2 B b d x -2 C a d x +C \tan \left (d x +c \right )^{2} b +B \ln \left (1+\tan \left (d x +c \right )^{2}\right ) a +2 B \tan \left (d x +c \right ) b -C \ln \left (1+\tan \left (d x +c \right )^{2}\right ) b +2 C \tan \left (d x +c \right ) a}{2 d}\) | \(79\) |
risch | \(-B b x -C a x +i B a x -i C b x +\frac {2 i B a c}{d}-\frac {2 i C b c}{d}+\frac {2 i \left (-i C b \,{\mathrm e}^{2 i \left (d x +c \right )}+B b \,{\mathrm e}^{2 i \left (d x +c \right )}+C a \,{\mathrm e}^{2 i \left (d x +c \right )}+B b +C a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) B a}{d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) C b}{d}\) | \(143\) |
[In]
[Out]
none
Time = 0.24 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00 \[ \int (a+b \tan (c+d x)) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {C b \tan \left (d x + c\right )^{2} - 2 \, {\left (C a + B b\right )} d x - {\left (B a - C b\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 2 \, {\left (C a + B b\right )} \tan \left (d x + c\right )}{2 \, d} \]
[In]
[Out]
Time = 0.10 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.59 \[ \int (a+b \tan (c+d x)) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\begin {cases} \frac {B a \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - B b x + \frac {B b \tan {\left (c + d x \right )}}{d} - C a x + \frac {C a \tan {\left (c + d x \right )}}{d} - \frac {C b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {C b \tan ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \tan {\left (c \right )}\right ) \left (B \tan {\left (c \right )} + C \tan ^{2}{\left (c \right )}\right ) & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00 \[ \int (a+b \tan (c+d x)) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {C b \tan \left (d x + c\right )^{2} - 2 \, {\left (C a + B b\right )} {\left (d x + c\right )} + {\left (B a - C b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 2 \, {\left (C a + B b\right )} \tan \left (d x + c\right )}{2 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 556 vs. \(2 (64) = 128\).
Time = 0.65 (sec) , antiderivative size = 556, normalized size of antiderivative = 8.42 \[ \int (a+b \tan (c+d x)) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=-\frac {2 \, C a d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 2 \, B b d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + B a \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - C b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 4 \, C a d x \tan \left (d x\right ) \tan \left (c\right ) - 4 \, B b d x \tan \left (d x\right ) \tan \left (c\right ) - C b \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, B a \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) + 2 \, C b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) + 2 \, C a \tan \left (d x\right )^{2} \tan \left (c\right ) + 2 \, B b \tan \left (d x\right )^{2} \tan \left (c\right ) + 2 \, C a \tan \left (d x\right ) \tan \left (c\right )^{2} + 2 \, B b \tan \left (d x\right ) \tan \left (c\right )^{2} + 2 \, C a d x + 2 \, B b d x - C b \tan \left (d x\right )^{2} - C b \tan \left (c\right )^{2} + B a \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) - C b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) - 2 \, C a \tan \left (d x\right ) - 2 \, B b \tan \left (d x\right ) - 2 \, C a \tan \left (c\right ) - 2 \, B b \tan \left (c\right ) - C b}{2 \, {\left (d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, d \tan \left (d x\right ) \tan \left (c\right ) + d\right )}} \]
[In]
[Out]
Time = 7.97 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.95 \[ \int (a+b \tan (c+d x)) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (B\,b+C\,a\right )+\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )\,\left (\frac {B\,a}{2}-\frac {C\,b}{2}\right )-d\,x\,\left (B\,b+C\,a\right )+\frac {C\,b\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2}}{d} \]
[In]
[Out]